package matchthreegame.utils;

import java.util.ArrayList;

import com.smartfoxserver.v2.entities.data.SFSArray;

public class StoreManager {
		
	public static SFSArray getSFSUpgradePrices() {
				
		return upgradePricesAsSFSArray();
		
	}
	
	
	public static SFSArray getSFSPurchaseRewards() {

		return purchasesRewardsAsSFSArray();
		
	}
	
	
	// Price of each upgrade level
	private static ArrayList<Integer> upgradePrices = new ArrayList<Integer>(){/**
		 * 
		 */
		private static final long serialVersionUID = 11L;

	{
		
		add(0);    // Level 0
		add(0);    // Level 1
		add(250);  // Level 2
		add(500);  // Level 3
		add(750);  // Level 4
		add(1000); // Level 5
		add(1500); // Level 6
		add(2000); // Level 7
		
	}};
	
	
	// Reward for each purchase offer
	private static ArrayList<Integer> purchasesRewards = new ArrayList<Integer>(){/**
		 * 
		 */
		private static final long serialVersionUID = 12L;

	{

		add(2000);  // S  Coins Package
		add(7000);  // M  Coins Package
		add(15000); // XL Coins Package

	}};
	
	
	// Convert upgradePrices to SFSArray
	private static SFSArray upgradePricesAsSFSArray() {
				
		ArrayList<Integer> upgradesArrayList = StoreManager.upgradePrices;
		
		SFSArray upgradePricesSfsArray = new SFSArray();
		
		for (int i = 0; i < upgradesArrayList.size(); i++) {
			upgradePricesSfsArray.addInt(upgradesArrayList.get(i));
		}
		
		return upgradePricesSfsArray;
		
	}
	
	
	// Convert purchasesRewards to SFSArray
	private static SFSArray purchasesRewardsAsSFSArray() {
		
		ArrayList<Integer> rewardsArrayList = StoreManager.purchasesRewards;
		
		SFSArray purchasesRewardsSfsArray = new SFSArray();
		
		for (int i = 0; i < rewardsArrayList.size(); i++) {
			purchasesRewardsSfsArray.addInt(rewardsArrayList.get(i));
		}
		
		return purchasesRewardsSfsArray;
		
	}
	
	
}
